package com.mydemo.design_pattern.create_type.single_pattern;


import java.io.*;

/**
 * <p></p >
 *
 * @author liming1
 * @version $Id: SingleObj1, v1.0 2019-09-18 14:32 liming1 Exp $
 */
public class SingleObj1 implements Serializable {

    private SingleObj1() {
    }

    private static final SingleObj1 SINGLE_OBJ = new SingleObj1();

    public static SingleObj1 getSingleObj() {
        return SINGLE_OBJ;
    }

    /**
     * 避免反序列是对象不一致
     * @return
     */
    private Object readResolve() {
        return SINGLE_OBJ;
    }
}
